/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.service.impl;

import com.icinfo.cloud.common.security.util.UserUtil;
import com.icinfo.cloud.provider.punish.mapper.CaseApprovalWaitRecordMapper;
import com.icinfo.cloud.provider.punish.service.ICaseApprovalWaitRecordService;
import com.icinfo.cloud.xzcf.provider.member.userinfo.dto.UserDTO;
import com.icinfo.framework.core.service.support.MyBatisServiceSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 描述: 案件文书待审批记录表 case_approval_wait_record 对应的Service接口实现类.<br>
 *
 * @author framework generator
 * @date 2022年03月30日
 */
@Service
public class CaseApprovalWaitRecordServiceImpl extends MyBatisServiceSupport implements ICaseApprovalWaitRecordService {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(CaseApprovalWaitRecordServiceImpl.class);

    @Resource
    private CaseApprovalWaitRecordMapper caseApprovalWaitRecordMapper;

    /**
     * 获取待审批数量
     * @param userId
     * @return
     */
    @Override
    public int countWaitHandle(String userId) {
        UserDTO userDTO = UserUtil.getUserInfo();
        return  caseApprovalWaitRecordMapper.countWaitHandle(userId,userDTO.getOrgCode());
    }

    @Override
    public int countWaitApproval(String userId, String orgCode) {
        return  caseApprovalWaitRecordMapper.countWaitHandle(userId,orgCode);
    }

}
